<!DOCTYPE html>
<html xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1">
	<meta name="description" content="A fully featured admin theme which can be used to build CRM, CMS, etc.">
	<meta name="author" content="Coderthemes">

    <!-- jQuery-->
    <script type="text/javascript" src="/plugins/jquery/jquery-3.6.0.min.js"></script>

    <!-- layui-->
    <link rel="stylesheet" href="/plugins/layui/2.7.6/css/layui.css" media="all">
    <script src="/plugins/layui/2.7.6/layui.js" charset="utf-8"></script>

    <!-- 基于laiui的表格 -->
    <script type="text/javascript" src="/plugins/layui/extends/sku/simple_table_view_before_create_order.js"></script>
</head>

<body>
	<form class="layui-form" id="id_form" method="post">
	
		<!-- 优惠结果结果 -->
		<div class="layui-form-item">
			<div id="simple_table_view_before_create_order">
			</div>
			<script th:inline="javascript">
			var tableOfSysDict = null;
			//使用layui的sku模块
			layui.use(['form', 'simple_table_view_before_create_order', 'jquery'], function(){
				var $ = layui.jquery,simple_table_view_before_create_order = layui.simple_table_view_before_create_order,form = layui.form;
            	
				tableOfSysDict = simple_table_view_before_create_order.init({ id:'simple_table_view_before_create_order', data: [], bid: '[(${dto.bid})]'});
				
				doReloadData();
			});
			</script>
		</div>

		<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;"></fieldset>
		<div class="layui-form-item">
			<div class="layui-col-md1 layui-col-md-offset11">
				<div class="layui-btn-container">
					<button type="button" class="layui-btn" onclick="doReloadData();"><i class="layui-icon layui-icon-refresh"></i>刷新</button>
				</div>
			</div>
		</div>
	</form>
	<script>
	
	function doReloadData() {
		$.post('[(${dto.urlApi15})]/api/outer/1688/viewBeforeCreate', {orderNo: '[[${dto.bid}]]' }, function(res){
			if (res.code == 0) {
				layer.msg('加载成功');
				console.log(res.data);
				tableOfSysDict.reloadRows(res.data.rows);
			} else {
				layer.msg(res.msg);
			}
		});
	}
	</script>
</body>
</html>